package courselection;

public class Teacher extends People {
    //private int id;  // 编号
    //private String name;    // 姓名
    //private String sex;    // 性别
    private Course teachCourse; // 所授课程

    // 空构造
    public Teacher() {
    }

    // 教师（编号、姓名、性别、所授课程）
    public Teacher(int id, String name, String sex, Course teachCourse) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.teachCourse = teachCourse;
    }

    // 打印教师信息
    public String toString() {
        return "\n老师课表：[" + "编号：" + id + "，姓名：" + name + "，性别：" + sex + "]"
                + "\n" + name + "授课信息：" + (teachCourse != null ? teachCourse.toString() : "未授课");
    }

    // 为教师设置所授课程
    public void setTeachCourse(Course teachCourse) {
        this.teachCourse = teachCourse;
    }

    // 下面是get、set方法
   /*public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
    */
    public Course getTeachCourse() {
        return teachCourse;
    }

}